/*
 * SelectElementMouseListener.cpp
 *
 *  Created on: 02-01-2011
 *      Author: Przemek
 */

#include "listener/SelectElementMouseListener.hpp"
#include "world/World.hpp"

bool SelectElementMouseListener::anySelected() const
{
	return (selected != 0);
}

Element* SelectElementMouseListener::getSelected()
{
	return selected;
}

void SelectElementMouseListener::clearSelection()
{
	selected = 0;
}

void SelectElementMouseListener::mousePressed(const MouseListener::EventArguments& arguments)
{
	selected = World::getInstance().getElementAt(arguments.getPoint());
}

